
package wwj.utils;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class test {
    public static void main(String[] args) {
        Connection connection=SqlUtil.getConnection();
                try {
            Statement statement = connection.createStatement();
            ResultSet resultSet = statement.executeQuery("select * from commodity");
            while (resultSet.next()) {
                int id = resultSet.getInt("id");
                String age = resultSet.getString("info");
                System.out.println("id:" + id + "   " + "age:" + age);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
